Hitherto known is an image processing apparatus which has a spatial filter which can be represented by a matrix of i rows and j columns. The spatial filter used in the image processing apparatus can have a desired filtering function, if a given coefficient is set in it. Depending on the pattern of the coefficient set in it, the spatial filter can perform a process, such as edge-emphasizing or noise-removing, on the input image.
FIG. 39 shows a spatial filter of the type incorporated in such an image processing apparatus.
The spatial filter shown in FIG. 39 comprises a 3.times.3 matrix. Each row of the matrix has data latch circuits 1 to 3 which are connected in series for sequentially latching pixel data items for the corresponding line. The pixel data items latched by the data latch circuits 1 to 3 are supplied to multiplying sections 4 to 6, respectively. Each of the sections 4 to 6 multiplies the pixel data item by a predetermined coefficient. The coefficients set to the multiplying sections 4 to 6 are stored in coefficient registers 7 to 9. They are supplied to the multiplying sections 4 to 6 through coefficient latch circuits 11 to 13, respectively.
Pixel data for the first line is input to the first-stage line 14. Pixel data for the second line is input to the second-stage line 15, and pixel data for the third line to the third-stage line 16. The product of the pixel value latched by each data latch and the coefficient stored in the corresponding coefficient register is input to an adder 17. The adder 17 adds the nine products input to it, and outputs the sum as the output of the spatial filter.
In the spatial filter of this structure, a frame image data is input three consecutive lines 14 to 16. The data is shifted by one pixel in each line. The pixel data for one line is thereby spatially filtered.
In the case of a 3.times.3 matrix filter, the pixel data processed by a single multiplication-addition operation represents the pixel located at the center of the matrix (i.e., the intersection of the second row and the second column).
Upon completion of the processing for one line, the line data input to the first to third lines 14 to 16 is shifted upwards or downwards by one line or more lines, and the image data for one line is processed again.
The spatial filter described above can perform image-processing functions such as local averaging, differentiation, edge-detection and the like, in accordance with the coefficients stored in the coefficient registers 7 to 9.
The coefficient registers 7 to 9 of the spatial filter are connected to the data bus of a CPU (not shown). Hence, the coefficients stored in the registers 7 to 9 can be rewritten by the CUP via the data bus.
In the conventional spatial filter, to rewrite the coefficients stored in the coefficient registers as described above, the CPU needs to make access to all coefficient registers through the data bus and to rewrite the coefficient stored in each register. If the spatial filter comprises a 3.times.3 matrix, the coefficient-rewriting operation must be repeated nine times. If the spatial filter comprises a 5.times.5 matrix, the coefficient-rewriting operation must be repeated 15 times. Therefore, with the conventional image processing apparatus it is required that the coefficients set in the spatial filter be switched, usually for every frame.
In actual image processing, however, it is demanded that a spatial filter be used which is set at a given coefficient for any desired region of a frame, and that various types of spatial filters be used for processing one frame. Such switching of filters can hardly be accomplished by using the functions of an ordinary personal computer.